package cn.yuanqiao.archive.detection.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 四性检测方案对象 YQ_DETECTION_SCHEME
 *
 * @author xy
 * @date 2023-08-07
 */
public class DetectionScheme extends BaseEntity
{
    private static final long serialVersionUID = 1L;

     public static final String BIGTABLENAME = "_YQ_DETECTION_SCHEME";

    public DetectionScheme() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
          // throw new ServiceException("tenantCode is null");
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }
    /** id */
    @IdAnnotation
    private Long id;

    /** 方案标识 */
    @Excel(name = "方案标识")
    private String identification;

    /** 检测阶段 */
    @Excel(name = "检测阶段")
    private String phase;

    /** 门类id */
    @Excel(name = "门类id")
    private Long categoryId;

    /** 类型 */
    @Excel(name = "类型")
    private String type;

    /** 分表名 */
    @Excel(name = "分表名")
    private String subTableName;

    /** 创建人 */
    @Excel(name = "创建人")
    private Long createId;

    /** 最新修改人 */
    @Excel(name = "最新修改人")
    private Long lastupdateId;

    private String lastupdateName;

    private String categoryName;

    private String tableName;

    /** 最新修改时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Excel(name = "最新修改时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date lastupdateTime;

    private Integer isDel;
    @Excel(name = "状态")
    private Integer state;




    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setIdentification(String identification)
    {
        this.identification = identification;
    }

    public String getIdentification()
    {
        return identification;
    }
    public void setPhase(String phase)
    {
        this.phase = phase;
    }

    public String getPhase()
    {
        return phase;
    }
    public void setCategoryId(Long categoryId)
    {
        this.categoryId = categoryId;
    }

    public Long getCategoryId()
    {
        return categoryId;
    }
    public void setType(String type)
    {
        this.type = type;
    }

    public String getType()
    {
        return type;
    }
    public void setSubTableName(String subTableName)
    {
        this.subTableName = subTableName;
    }

    public String getSubTableName()
    {
        return subTableName;
    }
    public void setCreateId(Long createId)
    {
        this.createId = createId;
    }

    public Long getCreateId()
    {
        return createId;
    }
    public void setLastupdateId(Long lastupdateId)
    {
        this.lastupdateId = lastupdateId;
    }

    public Long getLastupdateId()
    {
        return lastupdateId;
    }
    public void setLastupdateTime(Date lastupdateTime)
    {
        this.lastupdateTime = lastupdateTime;
    }

    public Date getLastupdateTime()
    {
        return lastupdateTime;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Integer getIsDel() {
        return isDel;
    }

    public void setIsDel(Integer isDel) {
        this.isDel = isDel;
    }

    public String getLastupdateName() {
        return lastupdateName;
    }

    public void setLastupdateName(String lastupdateName) {
        this.lastupdateName = lastupdateName;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }



    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("identification", getIdentification())
            .append("phase", getPhase())
            .append("categoryId", getCategoryId())
            .append("type", getType())
            .append("subTableName", getSubTableName())
            .append("createId", getCreateId())
            .append("createTime", getCreateTime())
            .append("lastupdateId", getLastupdateId())
            .append("lastupdateTime", getLastupdateTime())
            .toString();
    }
}
